<!DOCTYPE html>
<html lang="en">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <meta name="keywords" content="" />
  <meta name="description" content="" />
  <meta http-equiv="X-UA-Compatible" content="IE=EDGE,chrome=1" />
  <meta name="renderer" content="webkit" />
  <link rel="stylesheet" href="__STATIC__/index/css/base.css">
  <link rel="stylesheet" href="__STATIC__/index/css/login.css">
  <script src="__STATIC__/index/js/jquery-3.2.1.js"></script>
  <script src="__STATIC__/index/js/login.js"></script>
  <script src="__STATIC__/layui/layui.js"></script>
</head>
<script type="text/javascript">
	
	 function  chengclick(){
		 	var num = $('#email').val();
		 	var pwd= $('#pwd').val();
		 	var surepwd= $('#surepwd').val();
		 if(num==''){
		 		layui.use('layer', function(){
			  var layer = layui.layer;
			  layer.alert('请输入手机号', {icon: 2});
				});              
		 		return false;
		 	}
		 	if(pwd==''){
		 		layui.use('layer', function(){
			  var layer = layui.layer;
			  layer.alert('请输入密码', {icon: 2});
				});  
		 		return false;
		 	}
		 	if(surepwd==''){
		 		layui.use('layer', function(){
			  var layer = layui.layer;
			  layer.alert('请再次输入密码', {icon: 2});
				}); 
		 		return false;
		 	}
		 $.ajax({
		 		type:"post",
		 		url:"addUser",
		 		data:{num:num,pwd:pwd,surepwd:surepwd},
		 		success:function(res){
		 			if(res.code==1){
				 		layui.use('layer', function(){
					  var layer = layui.layer;
					  layer.alert(res.msg, {icon: 2},function(){
					  		location.reload(); 
					  });
						}); 
						
		 			}else if(res.code==2){
		 				layui.use('layer', function(){
					  var layer = layui.layer;
					  layer.alert(res.msg, {icon: 1},function(){
					  	location.href="{:url('index/login/login')}";
					  });
		 			 	}); 
		 		  }
		  	}
		  });
	 }
</script>
<body>
  <div class="header">
    <div class="w1200">
      <a href="/" class="logo">
        <img src="__STATIC__/index/img/ZJTLogo.jpg">
      </a>
      <!-- <ul class="right">
        <li><img src="https://img.dacaiji.com/static/image/LoginICON_01.png"><p class="text">海量精品任你推广</p>
        </li>
        <li><img src="https://img.dacaiji.com/static/image/LoginICON_02.png"><p class="text">优势互补抱团取暖</p>
        </li>
        <li><img src="https://img.dacaiji.com/static/image/LoginICON_03.png"><p class="text">快如闪电全天更新</p>
        </li>
      </ul> -->
    </div>
  </div>
  <div class="login-body register">
    <div class="w1200 body-con">
      <!-- 中心主图 -->
      <img src="#" alt="#">
      <!-- 登录form表单 -->
      <div class="login-form">
        <h3>
          <span class="welc">欢迎注册</span>
          <span class="right-txt">
            已有账号？ <a href="{:url('index/login/login')}">点击登录</a>
          </span>
        </h3>
        <div class="wrapper-form">
          <div class="form-input email">
            <input id="email" type="text" value="" name="num" placeholder="请输入手机号码">
            <p class="test-tips"></p>
          </div>
          <div class="form-input code">
            <input id="code" type="text" value="" placeholder="输入验证码">
            <p class="test-tips"></p>
            <button class="get-phone-verify hoverStyle" onclick="sendCode(this)">获取验证码</button>
          </div>
          <div class="form-input pwd">
            <input id="pwd" type="password" value="" name="pwd" onpaste="return false;" autocomplete="off" style="ime-mode:disabled" maxlength="24"
              placeholder="密码">
            <p class="test-tips"></p>
          </div>
          <div class="form-input surepwd">
            <input id="surepwd" type="password" value=""  name="surepwd"    onpaste="return false;" autocomplete="off" style="ime-mode:disabled" maxlength="24"
              placeholder="确认密码">
            <p class="test-tips"></p>
          </div>
        </div>
        <input type="button" class="button-login" value="注册" onclick="chengclick()" />
        <!--<a href="javascript:;" class="button-login" onclick="chengclick()">注 册</a>-->
      </div>
    </div>
  </div>
</body>
<script>
	
  $(".get-phone-verify").on("mouseover", function () {
    $(this).css({ 'background': '#4c6cc9', 'color': '#fff' })
  });
  $(".get-phone-verify").on("mouseout", function () {
    $(this).css({ 'background': '#fff', 'color': '#666' })
  })
     	      
		
		  	   
			
  
</script>

</html>